﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using IsmsExplorer.Model.Iso27001;
using IsmsExplorer.Infrastructure.EntityFactoryFramework;
using IsmsExplorer.Infrastructure.Helper;

namespace IsmsExplorer.Infrastructure.Repositories.Iso27001 {
    internal class Iso27001ControlFactory : IEntityFactory<Iso27001Control> {
        internal static class FieldNames {
            public const string ID = "ID";
            public const string ReferenceID = "ReferenceID";
            public const string Name = "Name";
            public const string Description = "Description";
            public const string SubsectionID = "SubsectionID";
        } // end internal static class FieldNames

        public Iso27001Control BuildEntity(System.Data.IDataReader reader) {
            return new Iso27001Control(DataHelper.GetInteger(reader[FieldNames.ID]), reader[FieldNames.ReferenceID].ToString(),
                                       reader[FieldNames.Name].ToString(), reader[FieldNames.Description].ToString());
        }
    } // end internal class Iso27001ControlFactory : IEntityFactory<Iso27001Control>


    internal class Iso27001ControlSubsectionFactory : IEntityFactory<Iso27001ControlSubsection> {
        internal static class FieldNames {
            public const string ID = "ID";
            public const string ReferenceID = "ReferenceID";
            public const string Name = "Name";
            public const string Objective = "Objective";
            public const string SectionID = "SectionID";
        } // end internal static class FieldNames

        public Iso27001ControlSubsection BuildEntity(System.Data.IDataReader reader) {
            return new Iso27001ControlSubsection(DataHelper.GetInteger(reader[FieldNames.ID]), reader[FieldNames.ReferenceID].ToString(), 
                                                 reader[FieldNames.Name].ToString(), reader[FieldNames.Objective].ToString());
        }
    } // end internal class Iso27001ControlSubsectionFactory : IEntityFactory<Iso27001ControlSubsection>

    internal class Iso27001ControlSectionFactory : IEntityFactory<Iso27001ControlSection> {
        internal static class FieldNames {
            public const string ID = "ID";
            public const string ReferenceID = "ReferenceID";
            public const string Name = "Name";
        } // end internal static class FieldNames

        public Iso27001ControlSection BuildEntity(System.Data.IDataReader reader) {
            return new Iso27001ControlSection(DataHelper.GetInteger(reader[FieldNames.ID]), reader[FieldNames.ReferenceID].ToString(), reader[FieldNames.Name].ToString());
        }
    } // end internal class Iso27001ControlSectionFactory : IEntityFactory<Iso27001ControlSection>
}
